function [value] = lin_interpo1(nx,gridx,v,x)
    
    widthx=gridx(2)-gridx(1);
    
    minx=gridx(1);
    maxx=gridx(nx);
    
    position_x=floor((x-minx)/widthx)+1;
    
    position_x=max(position_x,1);
	position_x=min(position_x,nx-1);

	weightx1=(x-gridx(position_x))/widthx;
	weightx2=1-weightx1;

	value=weightx1*v(position_x+1)+weightx2*v(position_x);


end



